package com.jianyun.jyzs.presenter;

import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
import com.jianyun.jyzs.dao.EngineerDao;
import com.jianyun.jyzs.model.CreateEngineerModel;
import com.jianyun.jyzs.model.imdoel.ICreateEngiModel;
import com.jianyun.jyzs.view.iview.ICreateEngineerView;

import java.util.HashMap;

/**
 * Created by yangshijun on 2018/5/31.
 */

public class CreateEngineerPresenter extends MvpBasePresenter<ICreateEngineerView> {


    /**
     * 获取单个项目动态
     * @param dao
     * @param map
     */
    public void getOneEngineer(EngineerDao dao, HashMap<String, String> map) {
        if (!isViewAttached()) return;
        getView().showLoading();
        CreateEngineerModel.getInstance().getOneEngineer(dao, map, new ICreateEngiModel.OnCreateEngineerListener() {
            @Override
            public void onCreateSuccess() {
                getView().hintLoading();
                getView().onGetEngineerSuccess();
            }

            @Override
            public void onFailed(String msg) {
                getView().hintLoading();
                getView().onFailed(msg);
            }
        });
    }
}
